export default class ProtocolResponse<T>{
    private code: number;
    private msg: string;
    private result: T;
    private timestamp: string

    /**
     * Getter code
     * @return {number}
     */
    public getCode(): number {
        return this.code;
    }

    /**
     * Getter msg
     * @return {string}
     */
    public getMsg(): string {
        return this.msg;
    }

    /**
     * Getter result
     * @return {T}
     */
    public getResult(): T {
        return this.result;
    }

    /**
     * Setter code
     * @param {number} value
     */
    public setCode(value: number) {
        this.code = value;
    }

    /**
     * Setter msg
     * @param {string} value
     */
    public setMsg(value: string) {
        this.msg = value;
    }

    /**
     * Setter result
     * @param {T} value
     */
    public setResult(value: T) {
        this.result = value;
    }

    public isSuccess(){
        return this.code == 0;
    }

}